import {showToast} from "vant";

function isWeiXin() {
    // 首先判断是否是微信内置浏览器，然后再去判断机型android iOS
    const uExplorer = window.navigator.userAgent.toLowerCase();
    const uUserAgent = navigator.userAgent;
    const isAndroid = uUserAgent.indexOf("Android");
    if (uExplorer.match(/MicroMessenger/i) === "micromessenger") {
        if (isAndroid > -1) {
            showToast("点击右上角，用浏览器打开进行下载");
        } else {
            showToast("请去App Store中进行下载");
        }
    } else {
        if (isAndroid > -1) {
            window.location.href = "https://fir.im/REITsAnd";
        } else {
            showToast("请去App Store中进行下载");
        }
    }
}

export default isWeiXin;
